#include<iostream>
using namespace std;
int main()
{
    int nums[] = { -1,0,3,5,9,12 };
    int target = 9;
    int l = 0;
    int r = sizeof(nums)/sizeof(nums[0]) - 1;
    while (l < r) {
        int mid = l + r + 1>> 1;
        if (nums[mid] <= target) {
            l = mid;
        }
        else {
            r = mid - 1;
        }
    }
    if (nums[r] == target) {
        cout << r << endl;
    }
    else {
        cout << -1 << endl;
    }
    return 0;
}